package cn.etcweb.bait.baitframe.base.service;

import cn.etcweb.bait.baitframe.base.mapper.MyMapper;

import java.io.Serializable;
import java.util.List;

public interface BaseService<T,D extends MyMapper<T>> {
    /**
     * 根据业务ID的到业务对象
     *
     * @param id
     * @return
     * @throws Exception
     */
    public T get(Serializable id) throws Exception;

    /**
     * 查找所有的业务对象 (不带查询条件)
     *
     * @return
     * @throws Exception
     */
    public List<T> queryAll() throws Exception;


    /**
     * 保存指定的业务对像
     *
     * @param entity
     * @throws Exception
     */
    public void save(T entity) throws Exception;

    /**
     * 删除指定的业务对像
     *
     * @param id
     * @throws Exception
     */

    public void deleteBusiness(Serializable id) throws Exception;

    /**
     * 删除对象
     *
     * @param ids
     * @return
     * @throws Exception
     */
    public void deleteBusiness(String[] ids) throws Exception;
}
